package com.xiaoran.springboot4.demo.service;

import com.xiaoran.springboot4.demo.bean.City;
import com.xiaoran.springboot4.demo.bean.User;
import com.xiaoran.springboot4.demo.mapper.CityMapper;
import com.xiaoran.springboot4.demo.mapper.Usermapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class ServiceImpl {

    @Autowired
    Usermapper usermapper;

    public User getid(int id){
        log.info("-------------------------");
        return usermapper.getUser(id);
    }

    @Autowired
    CityMapper cityMapper;

    public City city(int id){
        return cityMapper.getbyid(id);
    }

    public void  insettto(City city){
        cityMapper.insetinto(city);
    }


}
